<template>
    <div class="page">
        <swiperM :list="BannerList"></swiperM>

        <div class="download-container">
            <div class="bg-2"></div>

            <div class="download-main">
                <div class="title">下载VR/AR端·开启新视界体验</div>

                <div class="btn-group" style="margin-top: 39px;">
                    <div class="btn btn-experience" @click="onWebExperience">Web端体验</div>
                </div>

                <div class="btn-group">
                    <div class="btn btn-primary">VR端下载</div>
                    <div class="btn btn-default disabled">AR端下载</div>
                </div>

                <div class="info-box">
                    <div class="line">
                        VR 端云空间 ，一个超越想象的虚拟世界等待着您的探索！
                    </div>
                    <div class="line">
                        这里不仅仅是一个虚拟空间，更是一个融合了学习、展览、文旅、康养、社交、娱乐等多元素的奇妙天地。
                    </div>
                    <div class="line">
                        在学习中心，为您打开知识的全新大门。无论是深奥的科学原理，还是古老的历史文化，都能以生动逼真的方式呈现，让学习成为一场身临其境的奇妙冒险。
                    </div>
                    <div class="line">
                        在会展中心，各类艺术珍品、前沿科技成果触手可及。无需奔波于各地，就能在虚拟的展厅中领略世界的丰富多彩。
                    </div>

                    <div class="img-box">
                        <div class="img-item">
                            <img :src="`${_oss_}images/vr-download/img-1.jpg`" />

                            <div class="name">云课堂</div>
                        </div>

                        <div class="img-item">
                            <img :src="`${_oss_}images/vr-download/img-2.jpg`" />

                            <div class="name">云商业</div>
                        </div>
                    </div>

                    <div class="line">
                        在文旅大厅，您可以瞬间穿越到古老的城镇，漫步在历史的长街；也能置身于壮丽的自然景观，感受大自然的雄浑与美丽。
                    </div>
                    <div class="line">
                        在医疗中心，让您在虚拟中放松身心，享受宁静与舒适。
                    </div>
                    <div class="line">
                        娱乐的元素更是丰富多彩，刺激的游戏、精彩的表演，让您在虚拟世界中尽情释放自我。
                    </div>
                    <div class="line">
                        在云空间 VR
                        端，您不再是孤独的旅行者，而是与众多伙伴一同探索、一同欢乐的参与者。
                    </div>
                    <div class="line">
                        快来下载云空间 VR 端，开启属于您的全新体验和乐趣吧！
                    </div>

                    <div class="img-box">
                        <div class="img-item">
                            <img :src="`${_oss_}images/vr-download/img-3.jpg`" />

                            <div class="name">云文旅</div>
                        </div>

                        <div class="img-item">
                            <img :src="`${_oss_}images/vr-download/img-4.jpg`" />

                            <div class="name">云医疗</div>
                        </div>
                    </div>
                </div>
            </div>
        </div>

        <div class="container">
            <div class="download-box">
                <span class="download-btn">下载</span>

                <div class="download-desc">
                    <div class="download-info">
                        <div class="download-desc__title">更新信息</div>
                        <div class="download-desc__content">
                            <p class="download-desc__item">
                                版本号：{{ detail.version }}
                            </p>
                            <p class="download-desc__item">
                                发布日期：{{ detail.time }}
                            </p>
                            <p class="download-desc__item">
                                文件大小：{{ formatFileSize(detail.size || 0) }}
                            </p>
                        </div>
                    </div>
                    <div class="download-ask">
                        <div class="download-desc__title">配置要求</div>
                        <div class="download-desc__content">
                            <p class="download-desc__item" v-for="demand in SplitDemand(detail.demand)" :key="demand">
                                {{ demand }}
                            </p>
                        </div>
                    </div>
                </div>
            </div>
        </div>

        <div class="bg-1"></div>

        <div class="pic-list">
            <div class="pic-item" v-for="item in list" :key="item.id">
                <div class="pic-img">
                    <img :src="`${_oss_}images/mobile/vr-download/${item.id}.jpg` +
                        '?x-oss-process=image/watermark,image_' +
                        toBase64(
                            'water/logo_white.png?x-oss-process=image/resize,P_50'
                        ) +
                        ',g_center,t_50'
                        " />
                </div>
                <div class="pic-info">{{ item.id }}、{{ item.content }}</div>
            </div>
        </div>
    </div>
</template>
<script setup>
import { useContent } from ".";
const { detail, list, BannerList, GetInfo, GetBannerList } = useContent();

const SplitDemand = (demand) => {
    return demand ? demand.split("\r\n") : [];
};

const onWebExperience = () => {
    window.open("https://future.ykjhr.com/");
}

onMounted(async () => {
    await nextTick();
    GetInfo();
    GetBannerList(261);
});
</script>
<style lang="scss" scoped>
.page {
    background-color: #f5f5f5;

    :deep(.banner) {
        height: 175px;
    }

    .bg {
        width: 100%;
        height: 175px;
        background: url("https://yzpt-resources.oss-cn-hangzhou.aliyuncs.com/web/images/mobile/vr-download/new-bg.jpg") no-repeat 50% 0 / cover;
    }

    .bg-1 {
        width: 100%;
        height: 100px;
        background: url("https://yzpt-resources.oss-cn-hangzhou.aliyuncs.com/web/images/mobile/vr-download/bg-1.jpg") no-repeat 50% 0 / cover;
    }

    .download-container {
        position: relative;
        width: 100%;
        min-height: 540px;

        .bg-2 {
            position: absolute;
            left: 0;
            top: 0;
            width: 100%;
            height: 540px;
            background: url("https://yzpt-resources.oss-cn-hangzhou.aliyuncs.com/web/images/mobile/vr-download/bg-2.png") no-repeat 50% 0 / cover;
        }

        .download-main {
            position: relative;
            margin: 0 auto;
            padding-top: 38px;
            z-index: 2;

            .title {
                font-weight: 800;
                font-size: 18px;
                color: #000;
                text-align: center;
            }

            .btn-group {
                margin-top: 20px;
                display: flex;
                justify-content: center;

                .btn {
                    width: 110px;
                    height: 30px;
                    font-size: 14px;
                    display: flex;
                    align-items: center;
                    justify-content: center;

                    &+.btn {
                        margin-left: 42px;
                    }

                    &.disabled {
                        filter: grayscale(1);
                        cursor: not-allowed;
                    }
                }

                .btn-primary {
                    color: #fff;
                    font-weight: bold;
                    background-image: url("https://yzpt-resources.oss-cn-hangzhou.aliyuncs.com/web/images/mobile/vr-download/btn-active.png");
                    background-size: 100% 100%;
                }

                .btn-experience {
                    width: 262px;
                    color: #fff;
                    font-weight: bold;
                    background-image: url("https://yzpt-resources.oss-cn-hangzhou.aliyuncs.com/web/images/mobile/vr-download/btn-3.png");
                    background-size: 100% 100%;
                }

                .btn-default {
                    color: #5085fb;
                    background-image: url("https://yzpt-resources.oss-cn-hangzhou.aliyuncs.com/web/images/mobile/vr-download/btn-default.png");
                    background-size: 100% 100%;
                }
            }

            .info-box {
                width: 350px;
                margin: 45px auto 0;
                background: #ffffff;
                border-radius: 6px;
                padding: 16px 12px;

                .line {
                    font-size: 14px;
                    line-height: 24px;
                    text-indent: 2em;
                }
            }
        }

        .img-box {
            display: flex;
            justify-content: space-between;
            padding: 20px 0;

            .img-item {
                img {
                    width: 158px;
                    display: block;
                }

                .name {
                    font-size: 15px;
                    margin-top: 18px;
                    text-align: center;
                }
            }
        }
    }

    .container {
        padding: 10px 15px 20px;

        .tips {
            font-size: 16px;
            line-height: 28px;
            color: #333;
        }

        .download-box {
            background-color: #fff;
            padding: 15px 10px;
            border-radius: 3px;
        }

        .download-btn {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 125px;
            height: 40px;
            // background-color: #3f00f2;
            background-color: #ccc;
            color: #fff;
            border-radius: 20px;
            font-size: 18px;
            // cursor: pointer;
            text-decoration: none;
        }

        .download-desc {
            margin-top: 20px;

            &__title {
                color: #333;
                font-weight: bold;
                font-size: 16px;
            }

            &__content {
                display: flex;
                flex-wrap: wrap;
                white-space: pre-line;
            }

            &__item {
                margin-right: 50px;
                margin-top: 10px;
                color: #555;
                word-break: break-all;
                line-height: 22px;

                &:nth-of-type(2n) {
                    margin-right: 0px;
                }
            }
        }

        .download-ask {
            margin-top: 20px;
        }
    }

    .pic-list {
        display: flex;
        flex-wrap: wrap;
        justify-content: space-between;
        padding: 15px;

        .pic-item {
            width: 168px;
            margin-bottom: 20px;

            &:nth-of-type(2n) {
                margin-right: 0;
            }

            .pic-img {
                width: 168px;
                height: 168px;
                overflow: hidden;

                img {
                    width: 100%;
                    height: 100%;
                }
            }

            .pic-info {
                margin-top: 10px;
                font-size: 14px;
            }
        }
    }
}
</style>
